package com.tvunetworks.center.device.service;

import java.nio.channels.NotYetConnectedException;
import java.security.InvalidParameterException;

/**
* @author RichardYao richardyao@tvunetworks.com

*/
public interface AnywhereControlService {
	/**
	 * MAX_LENGTH
	 */
	 int MAX_LENGTH = 160;
	/**
	 * MAX_WIDTH
	 */
	 int MAX_WIDTH = 90;
	/**
	 * MIN_VALUE
	 */
	 int MIN_VALUE = 0;
	/**
	 * MAX_ZOOM
	 */
	 int MAX_ZOOM = 100;
	/**
	 * MAX_EXPOSURE
	 */
	 int MAX_EXPOSURE = 50;
	/**
	 * MIN_EXPOSURE
	 */
	 int MIN_EXPOSURE = -50;

	/**
	 * Set anywhere app to focus with specify point
	 * @param recipient recipient
	 * @param parameter parameter
	 * @throws NotYetConnectedException 编译异常
	 */
	void focusControlMsg(String recipient, int[] parameter) throws NotYetConnectedException;
	
	/**
	 * Set anywhere app to zoom with specify level
	 * @param recipient recipient
	 * @param parameter parameter
	 * @throws NotYetConnectedException 编译异常
	 */
	void zoomControlMsg(String recipient, int[] parameter) throws NotYetConnectedException;
	
	/**
	 * Set anywhere app to exposure with specify level
	 * @param recipient recipient
	 * @param parameter parameter
	 * @throws NotYetConnectedException 编译异常
	 */
	void exposureControlMsg(String recipient, int[] parameter) throws NotYetConnectedException;
	
	/**
	 * Set anywhere app to crop picture with specify point
	 * @param recipient recipient
	 * @param parameter parameter
	 * @throws NotYetConnectedException 编译异常
	 */
	void cropControlMsg(String recipient, int[] parameter) throws NotYetConnectedException;
	
	/**
	 * Open or close anywhere's crop and receive setted resolution
	 * @param recipient the device peerid
	 * @param openFlag 0: close, 1: open
	 * @throws InvalidParameterException 编译异常
	 * @return String
	 */
	String toggelCropStatus(String recipient, int[] openFlag) throws InvalidParameterException;
	
	/**
	 * Open or close anywhere's crop and receive setted resolution
	 * @param recipient the device peerid
	 * @param openFlag 0: close, 1: open
	 * @throws InvalidParameterException 编译异常
	 */
	void toggleCropStatus(String recipient, int[] openFlag) throws InvalidParameterException;
	
	/**
	 * User want to reset all effect: focus, zoom, exposure, crop
	 * @param recipient the device peerid
	 * @throws NotYetConnectedException 编译异常
	 */
	void resetAllEffect(String recipient) throws NotYetConnectedException;
	
	/**
	 * Query device resolution and wait for the resolution response
	 * @param recipient recipient
	 * @return String
	 * @throws NotYetConnectedException 编译异常
	 */
	String getDeviceResolution(String recipient) throws NotYetConnectedException;
	
	/**
	 * User want to query the device's resolution
	 * @param recipient recipient
	 * @throws NotYetConnectedException 编译异常
	 */
	void queryDeviceResolution(String recipient) throws NotYetConnectedException;

	/**
	 *
	 * @param recipient recipient
	 * @param openFlag openFlag
	 * @throws NotYetConnectedException 编译异常
	 */
	void isAuto(String recipient, int[] openFlag) throws NotYetConnectedException;
	
}
